from django.contrib import admin
from cms.models import Article
from cms.models import Menu,Catalog
from icssite.util.fields import RichText
from django.db import models
class MenuAdmin(admin.ModelAdmin):
    list_display = ('name','description','position','alternative_url','online')
    search_fields = ('name',)
    fields = ('name','description','position','alternative_url','online')
class CatalogAdmin(admin.ModelAdmin):
    list_display = ('name','description','position','alternative_url','online')
    search_fields = ('name',)
    fields = ('name','description','position','alternative_url','menu','online')
class ArticleAdmin(admin.ModelAdmin):
    list_display=('title','online')
    fields=('title','content','catalogs','online')
    formfield_overrides = {
        models.TextField:{'widget':RichText},

    }
    
admin.site.register(Menu,MenuAdmin)
admin.site.register(Catalog,CatalogAdmin)
admin.site.register(Article,ArticleAdmin)


  